package com.gill.ftp.config;

import com.gill.ftp.config.properties.FtpProperties;
import com.gill.ftp.util.FtpUtil;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @author ：gill
 * @description：ftp服务器相关配置信息
 */
@Configuration
public class FtpConfig {

	@Bean
	@ConfigurationProperties(prefix = "ftp")
	public FtpProperties ftpProperties(){
		return new FtpProperties();
	}

	@Bean
	public FtpUtil ftpUtil(){
		return FtpUtil.getInstance(ftpProperties());
	}
}
